const Router = require('koa-router');


// 引入service
const demoController = require('../controller/demoController')

// 摸块路由前缀，按需配置，不需要时可以注释掉
const PREFIX = "/demo";
const router = new Router({prefix: PREFIX});


router.get('/all', demoController.all);

router.post("/post", demoController.post);

router.post("/upload", demoController.upload);

router.get("/error", async (ctx, next) => {
    throw new Error("错误")
    let a =  1/ 0
    ctx.body = a
})



module.exports = router
